import mockjs from 'mockjs';
import { delay } from 'roadhog-api-doc';
import defaultSettings from '@/defaultSettings';

const proxy = {
  'POST /oqms/orderQuery/queryOrderPage': (req, res) => {
    res.send({
      resultObject: {
        totalCount: 1400,
        data: [
          {
            order_nbr: 'S09123912312449',
            abnormal_status: '00A',
            order_from_c: '一级能力开放平台',
            shipping_type: 'OAO',
            goods_name: '测试商品',
            type_code_c: '号卡销售',
            tid_time: '2019-07-11 09:27:44',
            phone_num: '13220000111',
            order_status_c: '撤单成功',
            pay_status: 1,
            order_amount: 120,
          },
          {
            order_nbr: 'S09123912312451',
            abnormal_status: '00A',
            order_from_c: '一级能力开放平台',
            shipping_type: 'OAO',
            goods_name: '测试商品',
            type_code_c: '号卡销售',
            tid_time: '2019-07-11 09:27:44',
            phone_num: '13220000111',
            order_status_c: '撤单成功',
            pay_status: 1,
            order_amount: 120,
          },
        ],
      },
    });
  },

  'POST /pmc/pms/StaticDataController/getAttrValueList.do': (req, res) => {
    switch (req.body.attrNbr) {
      case 'orderBusiType':
        res.send([
          {
            attrValue: '10000',
            attrValueName: '号卡销售',
          },
          {
            attrValue: '10001',
            attrValueName: 'OAO',
          },
        ]);
        break;
      case 'orderStatus':
        res.send([
          {
            attrValue: '99',
            attrValueName: '已撤单',
          },
          {
            attrValue: '88',
            attrValueName: '异常',
          },
        ]);
        break;
      case 'sourceType':
        res.send([
          {
            attrValue: '130',
            attrValueName: '一级能力开放平台',
          },
          {
            attrValue: '120',
            attrValueName: '合力云',
          },
        ]);
        break;
      case 'claimType':
        res.send([
          {
            attrValue: '10',
            attrValueName: '网选网送',
          },
          {
            attrValue: '20',
            attrValueName: '网选厅送',
          },
        ]);
        break;
      default:
        break;
    }
  },

  'GET /stafforg/areas/parent/0': (req, res) => {
    res.send({
      areaId: 1001,
      areaName: '南京地区',
    });
  },
};

export default delay(proxy, 1500);
